package com.cmcc.shared.data

import com.cmcc.shared.model.*
import kotlinx.coroutines.Deferred
import retrofit2.Response
import retrofit2.http.*

interface PlatformApiService {

    @POST("consumer/user/login")
    fun userLogin(@Body tokenInfo: LinkedToken): Deferred<Response<AppResponse<NetToken>>>

    @GET("consumer/user/card-info")
    fun getCardInfo(@Header("Authorization") token: String): Deferred<Response<AppResponse<CardInfo>>>

    /**
     * 查询正在进行的订单
     */
    @GET("consumer/order/in/process")
    fun queryOrderInProgress(@Header("Authorization") token: String, @Query("role") role: Int): Deferred<Response<AppResponse<OrderRecord>>>

    /**
     * 司机上班
     */
    @PUT("consumer/driver/status/1")
    fun onWrok(@Header("Authorization") token: String, @Body currentCoordinates: DriverCoordinates): Deferred<Response<AppResponse<Int>>>

    /**
     * 司机下班
     */
    @PUT("consumer/driver/status/0")
    fun offWrok(@Header("Authorization") token: String, @Body currentCoordinates: DriverCoordinates): Deferred<Response<AppResponse<Int>>>

    /**
     * 司机下班
     */
    @PUT("consumer/driver/work/status")
    fun switchWrok(@Header("Authorization") token: String, @Body currentCoordinates: DriverCoordinates): Deferred<Response<AppResponse<Int>>>

    /**
     * 司机轨迹批量上传
     * @param
     */
    @POST("consumer/driver-location/upload-batch")
    fun uploadBatch(@Header("Authorization") token: String, @Body listDriverTrice : List<DriverTrice>): Deferred<Response<AppResponse<String>>>

}